﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using Koonsoft.HYCRM.BLL;

public partial class Statistic_EmpolyeeSheet : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {
        if(!IsPostBack)
        {
            OrderStart.Text = DateTime.Now.AddDays(-2).ToString("yyyy-MM-dd");
            OrderEnd.Text = DateTime.Now.ToString("yyyy-MM-dd");

            BindData();
        }
    }

    private void BindData()
    {
        var starttime = OrderStart.Text.Trim();
        var endtime = OrderEnd.Text.Trim();

        GridView1.DataSource = new OrderBLL().StatisticOrdersGroupByEmpolyee(starttime,endtime);
        GridView1.DataBind();
        GridView1.Visible = true;
    }

    protected void Button1_Click(object sender, EventArgs e)
    {
        BindData();
    }
}